//
//  MapViewController.h
//  StanfordOrientation
//
//  Created by Gongmyung on 6/25/10.
//  Copyright 2010 . All rights reserved.
//

#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
#import "MapAnnotation.h"
#import "EventDetailTableViewController.h"
#import "ASIFormDataRequest.h"
#import "JSON.h"

@interface MapViewController : UIViewController <MKMapViewDelegate> {
	IBOutlet MKMapView	*mapView_;
	NSMutableArray *annotationsArray;
	IBOutlet UIButton *detailButton;
    IBOutlet UIButton *refreshButton;
    SBJSON *parser;
    bool firsttime;
    bool needsUpdate;
    
    NSManagedObjectContext *managedObjectContext;
}

@property (readonly) MKMapView *mapView_;
@property (nonatomic, retain) NSManagedObjectContext *managedObjectContext;
@property (readonly) UIButton *refreshButton;
@property (nonatomic, assign) bool needsUpdate;

- (id)initWithArray:(NSArray*)annotations;

- (void)downloadFinished:(NSString*)eventsToParse;

- (IBAction)changeType:(id)sender;

- (IBAction)refresh;

- (void)addEvents:(NSArray*)annotations;

- (void)addEvent:(Event*)eventToAdd;

- (void)centerAtLatitude:(double)lat longitude:(double)lon withSelected:(int)eid;

- (void) refreshMap;

- (void)updateFilters;

@end
